import type { FormConfigType } from '@/components/AppForm/type'
import type { TableConfigType } from '@/components/myTable/type'

export const formItemConfig: FormConfigType = {
    formItem: [
        {
            type: 'input',
            field: 'id',
            placeholder: '请输入角色id',
            label: '角色id',
        },
        {
            type: 'input',
            field: 'name',
            placeholder: '请输入用户名',
            label: '用户名'
        },

    ],

}
export const tableConfig: TableConfigType = {
    tableItem: [
        { label: 'ID', prop: 'id', align: 'center' },
        { label: '用户名', prop: 'name', align: 'center' },
        { label: '创建日期', prop: 'custom', align: 'center', slotName: "createDate" },
        { label: '介绍', prop: 'desc', align: 'center' },
        { label: '照片', prop: 'custom', align: 'center', slotName: "avatar" },
    ],
    btnItem: [
        { btnType: "primary", type: "view", text: "查看", permission: "view", isShow: true, icon: 'View' },
        { btnType: "primary", type: "edit", text: "编辑", permission: "edit", isShow: true, icon: "Edit" },
        { btnType: "danger", type: "delete", text: "删除", permission: "delete", isShow: true, icon: "Delete" }
    ],
    operateColumnConfig: {
        width: '250',
        align: 'left',
        fixed: 'right'
    },
    permission: {
        edit: 'edit',
        view: 'view',
        add: 'add',
        del: 'delete',
        update: "update"
    },
}

export const dialogFormItemConfig: FormConfigType = {
    formItem: [
        {
            type: 'input',
            field: 'id',
            placeholder: '请输入角色id',
            label: '请输入角色id',
            col: 24,
            width: "85%",
            height: "45px"
        },
        {
            type: 'input',
            field: 'name',
            placeholder: '请输入角色名称',
            label: '请输入角色名称',
            col: 24,
            width: "85%",
            height: "45px"
        },
        {
            type: 'input',
            field: 'desc',
            placeholder: '描述',
            label: '请输入描述',
            col: 24,
            width: "85%",
            height: "45px"
        },
        {
            type: 'input',
            field: 'Email',
            placeholder: '邮箱',
            label: '请输入邮箱',
            col: 24,
            width: "85%",
            height: "45px"
        },
        {
            type: 'date',
            field: 'date',
            placeholder: '创建日期',
            label: '请选择时间',
            col: 24,
            width: "85%",
            height: "45px"
        },

    ],
    rules: {
        name: [
            { required: true, message: "名称为必填项" }
        ],
        intro: [
            { required: true, message: "介绍为必填项" }
        ],
        createAt: [
            { required: true, message: "创建时间为必填项" }
        ]
    },
    showBtn: false
}